//
//  BBMyApplyDetailController.m
//  2222
//
//  Created by BearBaby on 16/3/25.
//  Copyright © 2016年 BearBaby. All rights reserved.
//

#import "BBMyApplyDetailController.h"
#import "BBSixHeader.h"
#import "BBMyApplyDetailViewCell.h"
@interface BBMyApplyDetailController ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong)UITableView* tableView;
@end

@implementation BBMyApplyDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"申请流程";
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, WINSIZEWIDTH, WINSIZEHEIGHT) style:UITableViewStyleGrouped];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    
    [self.view addSubview:self.tableView];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 2;

}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return 1;
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    BBMyApplyDetailViewCell* cell = nil;
    if (indexPath.section==0) {
        static NSString* identifire = @"Cell";
        cell = [self.tableView dequeueReusableCellWithIdentifier:identifire];
        if (!cell) {
            cell = [[BBMyApplyDetailViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifire];
            cell.delegate = self;
        }
    }else{
        UITableViewCell* cell1 = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
        cell1.textLabel.text = @"申请流程详情";
        cell1.textLabel.font = [UIFont systemFontOfSize:WINSIZEWIDTH/22];
        cell1.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        return cell1;
    }

    return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{

    return 0.0000001;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 15;

}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section==0) {
        CGFloat cellHeight = 0.0f;
        BBMyApplyDetailViewCell* cell = (BBMyApplyDetailViewCell*)[self tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath];
        cellHeight = cell.finalH;
        return cellHeight;
    }else
        return 44;
   


}
@end
